﻿package mortal.game.view.forging.view
{
    import com.mui.controls.*;
    import com.mui.events.*;
    import extend.language.*;
    import fl.data.*;
    import flash.display.*;
    import mortal.component.window.*;
    import mortal.game.manager.*;
    import mortal.game.view.common.*;
    import mortal.game.view.forging.data.*;
    import mortal.game.view.forging.renderer.*;
    import mortal.game.view.wizard.*;
    import mortal.mvc.interfaces.*;

    public class BackPackItemWin extends BaseWindow
    {
        private var _tabBar:GTabarNew;
        private var _itemList:GTileList;

        public function BackPackItemWin(param1:ILayer = null)
        {
            super(param1);
            this.init();
            this.layer = LayerManager.topLayer;
            return;
        }// end function

        private function init() : void
        {
            setSize(248, 156);
            title = Language.getString(41071);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            var _loc_1:* = Language.getArray(41072);
            this._tabBar = UIFactory.gTabBarNew(0, 31, _loc_1, 248, 156, 61, 22, this, this.onTabBarSelectedChange, "TabButtonNew");
            this._tabBar.selectedIndex = 0;
            this._itemList = UIFactory.tileList(14, 65, 250, 91, this);
            this._itemList.columnWidth = 44;
            this._itemList.rowHeight = 44;
            this._itemList.horizontalGap = 0;
            this._itemList.verticalGap = 0;
            this._itemList.setStyle("skin", new Bitmap());
            this._itemList.setStyle("cellRenderer", BackPackItemCellRenderer);
            return;
        }// end function

        private function onTabBarSelectedChange(event:MuiEvent = null) : void
        {
            return;
        }// end function

        public function set data(param1:Object) : void
        {
            var _loc_4:TransferPackData = null;
            var _loc_5:int = 0;
            var _loc_2:* = param1 as Array;
            var _loc_3:* = new DataProvider();
            for each (_loc_4 in _loc_2)
            {
                
                _loc_3.addItem(_loc_4);
            }
            if (_loc_2.length < 10)
            {
                _loc_5 = 0;
                while (_loc_5 < 10 - _loc_2.length)
                {
                    
                    _loc_3.addItem({});
                    _loc_5++;
                }
            }
            this._itemList.dataProvider = _loc_3;
            this._itemList.drawNow();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._tabBar.dispose(param1);
            this._itemList.dispose(param1);
            this._tabBar = null;
            this._itemList = null;
            paddingLeft = 2;
            paddingRight = 3;
            paddingBottom = 4;
            return;
        }// end function

    }
}
